package financial.sharing.center.contract.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import financial.sharing.center.common.enums.ContractDirectionEnum;
import financial.sharing.center.common.enums.ContractStageEnum;
import financial.sharing.center.common.enums.ContractTypeEnum;
import financial.sharing.center.common.enums.EnableStatusEnum;
import financial.sharing.center.contract.model.entity.Contract;
import financial.sharing.center.contract.model.entity.ContractDetail;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @ClassName SelectContractVO
 * @Description TODO
 * @Author guoyuhang
 * @ @csdn https://blog.csdn.net/qq_40788718
 * @Date 2021/4/9
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@ToString
public class SelectContractVO {

    private Integer contractId;

    private String businessLineName;

    private String firstParty;

    private String secondParty;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endTime;

    private String contractStageName;

    private String enableStatusValueName;
    /**合同类型*/
    private String contractTypeName;
    /**合同方向*/
    private String contractDirectionName;

    private Integer contractDetailId;
    /**预计收款或者付款*/
    private BigDecimal contractAmount;
    /**账单周期*/
    private String billPeriod;
    /**币种*/
    private String currencyDicCode;
    /**备注*/
    private String note;
    /**付款方式*/
    private String payMethod;

    public SelectContractVO(Contract contract, String businessLineName, ContractDetail contractDetail){
//        this.contractId = contract.getId();
//        this.businessLineName = businessLineName;
//        this.firstParty = contractDetail.getFirstParty();
//        this.secondParty = contractDetail.getSecondParty();
//        this.startTime = contract.getStartTime();
//        this.endTime = contract.getEndTime();
//        this.contractStageName = ContractStageEnum.int2Enum(contract.getContractStage()).getName();
//        this.enableStatusValueName = EnableStatusEnum.int2Enum(contract.getEnableStatusValue()).getName();
//        this.contractTypeName = ContractTypeEnum.int2Enum(contract.getContractType()).getName();
//        this.contractDirectionName = ContractDirectionEnum.int2Enum(contract.getContractDirection()).getName();
//        this.contractDetailId = contractDetail.getId();
//        this.contractAmount = contractDetail.getContractAmount();
//        this.billPeriod = contractDetail.getBillPeriod();
//        this.currencyDicCode = contractDetail.getCurrencyDicCode();
//        this.note = contractDetail.getNote();
//        this.payMethod = contractDetail.getPayMethod();
    }

    public SelectContractVO(){

    }
}
